<template>
	<view class="go-top">
		<text @click="go">回到顶部</text>
	</view>
</template>

<script>
	export default {
		name:"goTop",
		data() {
			return {
				
			};
		},
		methods:{
			go(){
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 100
				});
			}
		}
	}
</script>

<style scoped lang="scss">
.go-top{
	position: fixed;
	right: 30rpx;
	bottom: 140rpx;
	width: 100rpx;
	height: 100rpx;
	border: 1px solid #aaa;
    border-radius: 50%;
	text-align: center;
	font-size: 37rpx;
	opacity: 0.5;
	&:active {
           opacity: 1;
        }
}
</style>